package gentle.controller;

import gentle.entity.SearchPaymentTotalInfo;
import gentle.service.ICostDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 项目明细
 * @author py
 * @Date 2018年4月19日23:15:54
 */
@Controller
@RequestMapping("/costDetails")
public class CostDetailsController{

    @Autowired
    ICostDetailsService costDetailsService;

    //项目明细
    @RequestMapping(value = "/getCostDetailsReport", method = RequestMethod.POST)
    @ResponseBody
    public List<Map<String, Object>> getCostDetailsReport(SearchPaymentTotalInfo searchPaymentTotalInfo, String reach) {
        return costDetailsService.getCostDetailsReport(searchPaymentTotalInfo,reach);
    }

    //导出
    @RequestMapping(value = "/exportCostDetailedTable")
    public void exportCostDetailedTable(@RequestParam(required = false) String startTime,@RequestParam(required = false) String endTime,
                                        @RequestParam(required = false) String reach,@RequestParam(required = false) String abbreviation,
                                        @RequestParam(required = false) String fieldTc,@RequestParam(required = false) int phonePrivilegesexp,
                                        @RequestParam(required = false) String doctor,@RequestParam(required = false) String userAccount,
                                        @RequestParam(required = false) String customerStatus,@RequestParam(required = false) String areaAbbreviation,HttpServletResponse response) {
        costDetailsService.exportCostDetailedTable(startTime,endTime,reach,abbreviation,fieldTc,phonePrivilegesexp,doctor,userAccount,areaAbbreviation,customerStatus, response);
    }

}